import React from 'react';

class Authority extends React.Component {
  render() {
    const { children, authority, noMatch = null } = this.props;
    const childrenRender = typeof children === 'undefined' ? null : children;
    if (authority === undefined) {
      return noMatch;
    } else {
      return childrenRender;
    }
  }
}

export default Authority;
